PROJECT("Walle")

SET(SRC_PATH "${PROJECT_SOURCE_DIR}")
SET(ROOT_PATH "${SRC_PATH}/../")

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
MESSAGE("Application: plsa_train")

ADD_DEFINITIONS(
  "-D_MT"
  "-DDEBUG"
  "-D_REENTRANT"
  "-D_PTHREADS=6"
  "-D__STDC_FORMAT_MACROS"
  "-D__STDC_CONSTANT_MACROS"
  "-DLIB_03"
)

INCLUDE_DIRECTORIES(
${SRC_PATH}/core
${SRC_PATH}/loader
${SRC_PATH}/common
${ROOT_PATH}/include
)

LINK_DIRECTORIES(
${ROOT_PATH}/lib
)

SET(LIBS
mpichcxx
mpich
mpl
opa
cblas
lapack
blas
gflags
pthread
rt
)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -fopenmp --static -fPIC -O3")
SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
MESSAGE(STATUS "CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

SET(EXECUTABLE_OUTPUT_PATH "${ROOT_PATH}/bin")

SET(PLSA_SRC_LIST
${SRC_PATH}/main/plsa_train.cc
${SRC_PATH}/core/plsa_resolver.cc
${SRC_PATH}/common/util.cc
${SRC_PATH}/common/critical_section.cc
${SRC_PATH}/loader/simple_loader.cc
)

ADD_EXECUTABLE(plsa_train ${PLSA_SRC_LIST})
TARGET_LINK_LIBRARIES(plsa_train ${LIBS})

